package com.cowithgun.maxcallvolume;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.media.AudioManager;
import android.content.Context;

public class MaxCallVolumeActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AudioManager audio = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
        int v = audio.getStreamVolume(audio.STREAM_VOICE_CALL);
        int m = audio.getStreamMaxVolume(audio.STREAM_VOICE_CALL);
        audio.setStreamVolume(audio.STREAM_VOICE_CALL, m, 0);
        TextView tv = new TextView(this);
        String s = "Current in-call volume is "+v + "\nIn-call volume adjusted to Max ("+m+")!\n -cowithgun"; 
        tv.setText(s);
        setContentView(tv);
    }
}